<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>SNAP Tutorial. Section 2.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {color: #CC0000}
-->
</style>
</head>

<body>
<h2>Section 2. Loading a 3D Image File </h2>
<p>Reading a three dimensional image is not as simple as opening a document in a word processor. To facilitate this process, SNAP offers a special wizard for loading images. This section of the tutorial will guide you through the different pages of this wizard. It will take 5 to 15 minutes to complete. </p>
<hr>
<h3><a name="Download"></a>Step 1. Download an Example Image [recommended]</h3>
<p>We strongly recommend that you use a set of images that we have provided as an example during this tutorial. A compressed file containing these images can be downloaded using the link shown below. <em>Please note that the image can not be downloaded using the SNAP help viewer.</em> <em>Copy the link and open it in an external web browser.</em></p>
<blockquote>
  <p><a href="http://www.itksnap.org/download/snap/files/MRI-crop.zip">http://www.itksnap.org/download/snap/files/MRI-crop.zip</a></p>
</blockquote>
<p>Save the file <strong>MRI-crop.zip </strong>in a convenient directory. This file is a compressed archive, and can be opened using a decompression utility such as <strong>WinZip</strong>&reg; on Windows or <strong>unzip </strong> on Unix. The archive contains the following files: </p>
<table width="89%" border="0" align="center">
  <tr bgcolor="#CCCCCC">
    <td>MRIcrop-orig.gipl</td>
    <td>An MRI image of a volunteer's brain </td>
  </tr>
  <tr>
    <td>MRIcrop-seg.gipl</td>
    <td>An example segmentation of the MRI image done using SNAP. </td>
  </tr>
  <tr bgcolor="#CCCCCC">
    <td>MRIcrop-seg.label</td>
    <td>A file containing label descriptions for the segmentation </td>
  </tr>
</table>
<p>Please consult your system administrator if you need help with downloading and extracting the example images. </p>
<hr>
<h3>Step 2. Open the 'Load Image' Wizard.</h3>
<p>Launch SNAP if you have not done so already. </p>
<table width="80%"  border="1" align="center" cellpadding="4" cellspacing="0">
  <tr>
    <td valign="top"><img src="Artwork/ttIconAction.gif" width="36" height="36"></td>
    <td>Select <strong>File | Load Data | Greyscale Image</strong> using the menu bar located at the top left corner of the SNAP window, as shown in the picture below:</td>
  </tr>
</table>
<p align="center"><img src="Artwork/ttLoadImageMenuBar.gif" width="190" height="96" border="2"></p>
<p align="left">The wizard will appear, as shown below:</p>
<p align="center"><img src="Artwork/ttLoadImageWizardPreview.gif" width="286" height="217"></p>
<hr>
<h3>Step 3. Select the Image File.</h3>
<p>There are three ways to specify the filename of the greyscale image. First, the filename can be typed into or pasted into the text box at the top of the wizard. Second, the 'Browse...' button can be used to locate the image file in your computer's file system. Finally, the 'History' button can be used to select a file that has been recently opened. </p>
<table width="80%"  border="1" align="center" cellpadding="4" cellspacing="0">
  <tr>
    <td width="36" valign="top"><img src="Artwork/ttIconAction.gif" width="36" height="36"></td>
    <td>Click the 'Browse...' button.  The following window will appear:</td>
  </tr>
</table>
<p align="center"><img src="Artwork/ttLoadImageBrowser.gif" width="299" height="248"> </p>
<table width="80%"  border="1" align="center" cellpadding="4" cellspacing="0">
  <tr>
    <td><img src="Artwork/ttIconTip.gif" width="36" height="36"></td>
    <td>Notice that the file browser includes a 'Favorites' menu, which can be used to remember and quickly access frequently used directories. </td>
  </tr>
</table>
<p align="left">We suggest you that for this tutorial you use the file <strong>MRIcrop-orig.gipl</strong>, which can be downloaded using the instructions given at the beginning of this section. </p>
<table width="80%"  border="1" align="center" cellpadding="4" cellspacing="0">
  <tr>
    <td width="36" valign="top"><img src="Artwork/ttIconAction.gif" width="36" height="36"></td>
    <td>Use the file list to find and select an image, and press <strong>OK</strong>. </td>
  </tr>
</table>
<p>Once you select an image, its compete filename and image format will be displayed in the wizard, as illustrated below. SNAP tries to guess the format of the image file based on the file's extension. For some files, SNAP may not guess correctly, and you will need to select the correct format from the drop box.</p>
<p align="center"><img src="Artwork/ttLoadImageWizardPreviewWithFile.gif" width="286" height="217"></p>
<table width="80%"  border="1" align="center" cellpadding="4" cellspacing="0">
  <tr>
    <td width="36" valign="top"><img src="Artwork/ttIconAction.gif" width="36" height="36"></td>
    <td>Press the 'Next' button to continue to the next page of the wizard.</td>
  </tr>
</table>
<br>
<table width="80%"  border="1" align="center" cellpadding="4" cellspacing="0">
  <tr>
    <td width="36" valign="top"><img src="Artwork/ttIconExpert.gif" width="36" height="36"></td>
    <td>If you have selected to read an image in RAW file format (this is an advanced feature), please follow this <a href="ManualSectionRAWInput.html">link</a> for additional information, before proceeding to the next subsection.</td>
  </tr>
</table>
<br>
<hr>
<h3><a name="Orientation"></a>Step 4. Specify Image Orientation. </h3>
<p>A volumetric image is a three-dimensional array of intensities. Every pixel in the image is referenced by three coordinates, <strong>x</strong>, <strong>y</strong>, and <strong>z</strong>, with <strong>z</strong> indicating the number of the slice to which the pixel belongs, <strong>y</strong> indicating the row in the slice, and <strong>x</strong> indicating the column. In order to display images correctly, SNAP needs to know the mapping between this <strong>x, y, z</strong> <em>image coordiate system </em>and the <em>patient coordinate system</em>. In other words, SNAP needs to know the mapping between directions <strong>x, y, z</strong> and the right-left, anterior-posterior or inferior-superior directions in the human body. </p>
<p>The orientation page of our wizard is used to specify this mapping, and it is shown below. </p>
<p align="center"><img src="Artwork/ttLoadImageWizardOrientation.gif"> </p>
<p>This page is used to specify the mapping between the patient coordinate system and the coordinate axes of the three-dimensional image. The orientation can be specified by (a) selecting one of the preset modes, (b) selecting 'Custom Orientation' in the preset drop box and assigning a patient direction to each image axis, or (c) by specifying a three-letter 'RAI' code.</p>
<table width="80%"  border="1" align="center" cellpadding="4" cellspacing="0">
  <tr>
    <td valign="top"><img src="Artwork/ttIconTip.gif" width="36" height="36"></td>
    <td>RAI codes let you specify image orientation quickly. Each of the three letters in the code is an abbreviation for the direction in the patient coordinate system. For example, the code ASR means that the X axis corresponds to the anterior-posterior direction, the Y corresponds to the superior-inferior direction, and the Z corresponds to the right-left direction. The origin of the image is in the anterior-superior-right corner of the body. </td>
  </tr>
</table>
<br>
<table width="80%"  border="1" align="center" cellpadding="4" cellspacing="0">
  <tr>
    <td width="36" valign="top"><img src="Artwork/ttIconAction.gif" width="36" height="36"></td>
    <td><p>For the image <strong>MRIcrop-orig.gipl</strong>, use the default orientation setting. </p>
      <p>For other images, specify the appropriate setting. If you don't know the correct setting for your image, just use the default. You will still be able to use most of SNAP functionality. </p>
    <p>Press the 'Next' button to continue.</p></td>
  </tr>
</table>
<hr>
<h3>Step 5. Review Image Information.</h3>
<p>The last page of the wizard shows summary information about the loaded image. </p>
<p align="center"><img src="Artwork/ttLoadImageWizardSummary.gif"></p>
<table width="80%"  border="1" align="center" cellpadding="4" cellspacing="0">
  <tr>
    <td width="36" valign="top"><img src="Artwork/ttIconAction.gif" width="36" height="36"></td>
    <td>Press the 'Finish' button to continue. </td>
  </tr>
</table>
<p>The wizard will disappear and the SNAP main window will display the image:</p>
<p align="center"><img src="Artwork/ttLoadImageResult.gif" width="266" height="223"></p>
<hr>
<p>&nbsp;</p>
</body>
</html>
